import { createRouter, createWebHistory } from 'vue-router'
import sidebarRoutes from './sidebar'

const routes = [
	{
		path: '/',
		redirect: sidebarRoutes.at(-1).path,
	},
	...sidebarRoutes,
	{
		path: '/:pathMatch(.*)*',
		redirect: '/',
	},
]

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes,
})

export default router
